package com.briup.jdbc;

import java.sql.SQLException;
import java.util.List;

public class UtilTest {
    public static void main(String[] args) {
        String sql = "select  *  from  s_dept";
        List<Dept> depts = JDBCUtil.executeDQL(sql, (resultSet) -> {
            try {
                int id = resultSet.getInt("id");
                String name = resultSet.getString("name");
                int region_id = resultSet.getInt("region_id");
                Dept dept = new Dept(id, name, region_id);
                return dept;
            } catch (SQLException e) {
                e.printStackTrace();
            }
            return null;

        });
        System.out.println(depts);
    }
}
